﻿Public Class frmMain

    Private Sub BorrarTodasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorrarTodasToolStripMenuItem.Click
        MiJuego.BorrarTodas()
    End Sub

    Private Sub JugarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles JugarToolStripMenuItem.Click
        frmJugar.ShowDialog()
    End Sub

    Private Sub AñadirPalabrasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AñadirPalabrasToolStripMenuItem.Click
        frmAñadir.ShowDialog()
    End Sub

    Private Sub BorrarPalabrasToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BorrarPalabrasToolStripMenuItem.Click
        frmBorrar.ShowDialog()
    End Sub

    Private Sub SalirToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SalirToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        If MiJuego.cambio = True Then
            Dim resp As DialogResult = MessageBox.Show("Ha habido cambios, ?guardarlos?", "ATención", MessageBoxButtons.YesNoCancel)
            If resp = Windows.Forms.DialogResult.Yes Then
                MiJuego.Guardar()
            End If
            If resp = Windows.Forms.DialogResult.Cancel Then
                e.Cancel = True ' Se cancela el cierre
            End If
        End If
    End Sub

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
